<?php
include_once 'lib/Application.php';
include_once 'lib/Http/Request.php';
include_once 'lib/Http/Response.php';

include_once 'AOP/Test.php';
include_once 'Interceptors/MyInterceptor.php';

include_once 'Controller/Index.php';

Interceptors::add("Index@*",new MyInterceptor());
AOP::addAspect("Index@*",new Test());


Router::get("/index/*","Index@hello");
Router::get("/","Index@hello");
Router::post("/","Index@hello");
ini_set("display_errors", "On");//打开错误提示
ini_set("error_reporting",E_ALL);//显示所有错误
$app = new Application(new Request(),new Response());
//$app->setDataSources("mysql:host=localhost;dbname=blog;port=3306;charset=utf8","root","root");
$app->run();